package mk.gamemap.view.anime
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;

	public class AnimeClip
	{
		public var animeArr:Array
		public var curAnime:IAnime
		public var displayObj:Bitmap
		public function AnimeClip(animeArr:Array)
		{
			this.animeArr=animeArr;
			displayObj=new Bitmap();
			gotoAnime(0)
		}
		
		public function get curAnimeName():String{
			return curAnime.name;
		}
		
//		public function get source():DisplayObject{
//		}
//		
//		public function get curFrame():int{
//		}
//		
//		public function get totalFrames():int{
//		}
//		
//		public function get isEnd():Boolean{
//		}
		
		public function showAnime(name:String):void{
			
		}
		
		public function gotoAnime(index:int):void{
			if (curAnime){
				curAnime.reset();
			}
			
			curAnime=animeArr[index];
			displayObj.bitmapData=(curAnime as BitmapAnime).image
		}
		
		public function gotoAndStop():void{
			
		}
		
		public function prevFrame():void{
			curAnime.prevFrame()
			displayObj.bitmapData=(curAnime as BitmapAnime).image
		}
		
		public function nextFrame():void{
			curAnime.nextFrame()
			displayObj.bitmapData=(curAnime as BitmapAnime).image
		}
		
		public function reset():void{
			curAnime.reset();
			
		}
	}
}